package io.renren.common.utils;

import java.util.UUID;

public class UuidUtils {

    public static String getUUID16(){
        String uuid= UUID.randomUUID().toString();
        char[] cs=new char[32];
        char c=0;
        for(int i=uuid.length()/2,j=1;i-->0;){
            if((c=uuid.charAt(i))!='-'){
                cs[j++]=c;
            }
        }
        return String.valueOf(cs);
    }

    public static String getUUID32(){
        return UUID.randomUUID().toString().replace("-", "").toLowerCase();
    }

    public static void main(String[] args) {
        String id= getUUID16();
        System.out.println(id);
        System.out.println(getUUID32());
    }
}
